1. Field of the Invention
The present invention generally relates to data processing and more particularly to saving query conditions as reusable query components.
2. Description of the Related Art
Databases are computerized information storage and retrieval systems. A relational database management system is a computer database management system (DBMS) that uses relational techniques for storing and retrieving data. The most prevalent type of database is the relational database, a tabular database in which data is defined so that it can be reorganized and accessed in a number of different ways. A distributed database is one that can be dispersed or replicated among different points in a network. An object-oriented programming database is one that is congruent with the data defined in object classes and subclasses.
Regardless of the particular architecture, in a DBMS, a requesting entity (e.g., an application or the operating system) demands access to a specified database by issuing a database access request. Such requests may include, for instance, simple catalog lookup requests or transactions and combinations of transactions that operate to read, change and add specified records in the database. These requests are made using high-level query languages such as the Structured Query Language (SQL). Illustratively, SQL is used to make interactive queries for getting information from and updating a database such as International Business Machines' (IBM) DB2, Microsoft's SQL Server, and database products from Oracle, Sybase, and Computer Associates. The term “query” denominates a set of commands for retrieving data from a stored database. Queries take the form of a command language that lets programmers and programs select, insert, update, find out the location of data, and so forth.
Queries are constructed of query conditions that serve to filter results returned from the query. Accordingly, a query may be thought of as group of filters put together to sift out only the data in which they are interested. Often, multiple queries are constructed using common query conditions. For example, in a medical database environment, multiple queries may include query conditions based on age and diagnoses to filter out a set of patients within a certain age range with a certain disease or set of diseases. It may be desirable to reuse common query conditions, rather than reconstruct database queries from scratch.
A conventional approach to reuse common query conditions is to save queries including the common query conditions as scripts. A script generally refers to a file containing a query that can be run to execute the query against a database. Scripts may be copied and edited to include and/or modify query statements, as necessary. In other words, a user wanting to generate a new query may search for a script having desired query conditions, and edit the script rather than creating the new query from scratch.
However, one problem associated with this approach is that properly editing the script to generate the new query may require expertise in a query language and the database being queried. In other words, even editing a script may be beyond the scope of an end user of the data (e.g., a researcher), and may be limited to programmers. Another problem associated with this approach is that it may be difficult to organize scripts in a useful manner that allows the user to identify query conditions contained in the scripts. For example, scripts may be saved with somewhat cryptic file names that fail to identify query conditions in the script. Therefore, even a programmer may waste time searching through scripts analyzing the actual query conditions to find a script with the desired query conditions.
Therefore, there is a need for an improved method for saving and reusing query conditions.